//
//  LKMIneCardViewController.m
//  YLHelper
//
//  Created by she1323 on 2018/5/11.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKMIneCardViewController.h"
#import "LKMineCardCell.h"
#import "LKMineCardHeaderView.h"
#import "LKMineCardTypeChooseView.h"
#import "LKMIneCardOtherCell.h"
#import "LKMIneCardOtherBottomCell.h"
#import "LKMineCardHeaderOtherView.h"
#import <UMShare/UMShare.h>
#import <UShareUI/UShareUI.h>
#import "LKDayInforPersonInforEditViewController.h"
@interface LKMIneCardViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)LKBaseTableview *tableview;
@property(nonatomic,strong)NSArray *titlesArray;
@property(nonatomic,strong)NSArray *imagesArray;
@property(nonatomic,strong)NSArray *images2Array;
@property(nonatomic,strong)UIImageView *bgImageView;
@property(nonatomic,strong)LKMineCardTypeChooseView *chooseView;
@property(nonatomic,strong)UIView *bgView;
@property(nonatomic,assign)BOOL defaluetStyle;
@property(nonatomic,strong)NSArray *usersArray;
@property(nonatomic,strong)NSArray *users2Array;
@property(nonatomic,assign)BOOL selectStyle;
@end

@implementation LKMIneCardViewController
-(LKBaseTableview *)tableview{
    if (!_tableview) {
        _defaluetStyle = YES;
        _tableview = [LKBaseTableview setTableviewWithFrame:CGRectMake(0, NAVIGATION_BAR_HEIGHT, WIDTH, HEIGHT - NAVIGATION_BAR_HEIGHT) style:UITableViewStyleGrouped registercellClasss:@[@"LKMineCardCell",@"LKMIneCardOtherCell",@"LKMIneCardOtherBottomCell"]];
        [self.view addSubview:_tableview];
        _tableview.delegate = self;
        _tableview.dataSource = self;
        _tableview.backgroundColor = [UIColor clearColor];
        _tableview.estimatedSectionHeaderHeight = 200;
        _tableview.estimatedRowHeight = 200;
    }
    return _tableview;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    _bgImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
    _bgImageView.userInteractionEnabled = YES;
    [self.view addSubview:_bgImageView];
    _bgImageView.image = [UIImage imageNamed:@"bg1"];
    self.tableview.estimatedRowHeight = 200;
    self.tableview.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(getReloadAccountDetailInformation)];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noticeAction:) name:@"mineCardStyleNotice" object:nil];
//    [self getReloadAccountDetailInformation];
    // Do any additional setup after loading the view.
}
/**
 获取用户详情
 */
-(void)getReloadAccountDetailInformation{
    [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:UserDetailUrl header:[LKUserInforTool header] parameters:nil progress:^(NSProgress * _Nullable progress) {
        
    } success:^(BOOL isSuccess, id  _Nullable responseObject) {
        LKUserInfor *userInfor = [LKUserInfor accountWithDict:responseObject[@"result"]];
        userInfor.token = [LKUserInforTool account].token;
        [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:userAccountCaculationUrl header:[LKUserInforTool header] parameters:nil progress:^(NSProgress * _Nullable progress) {
            
        } success:^(BOOL isSuccess, id  _Nullable responseObject) {
            [self.tableview.mj_header endRefreshing];
            NSString *customerCout = [NSString stringWithFormat:@"%@",responseObject[@"result"][@"cusertomerCount"]];
            NSString *investMoney = [NSString stringWithFormat:@"%@",responseObject[@"result"][@"orderInverstment"]];
            NSString *investFundMoney = [NSString stringWithFormat:@"%@",responseObject[@"result"][@"orderInverstmentFund"]];
            userInfor.cusertomerCount = customerCout;
            userInfor.orderInverstment = investMoney;
            userInfor.orderInverstmentFund = investFundMoney;
            [LKUserInforTool saveAccount:userInfor];
            if (_defaluetStyle) {
                LKUserInfor *user = [LKUserInforTool account];
                NSString *userName = [NSString judegeIsNullAndTransform:user.name];
                NSString *postName = [NSString judegeIsNullAndTransform:user.postName];
                NSString *positonName = [NSString stringWithFormat:@"%@(%@)",userName,postName];
                NSString *serialNumber = [NSString judegeIsNullAndTransform:user.userSerialNumber];
                NSString *corporateName = [NSString judegeIsNullAndTransform:user.corporateName];
                NSString *tel = [NSString judegeIsNullAndTransform:user.tel];
                NSString *city = [NSString judegeIsNullAndTransform:user.city];
                NSString *personalProfile = [NSString judegeIsNullAndTransform:user.personalProfile];
                self.usersArray = @[positonName,serialNumber,corporateName,tel,city,personalProfile];
            }else{
                LKUserInfor *user = [LKUserInforTool account];
                NSString *serialNumber = [NSString judegeIsNullAndTransform:user.userSerialNumber];
                NSString *corporateName = [NSString judegeIsNullAndTransform:user.corporateName];
                NSString *tel = [NSString judegeIsNullAndTransform:user.tel];
                NSString *city = [NSString judegeIsNullAndTransform:user.city];
                NSString *personalProfile = [NSString judegeIsNullAndTransform:user.personalProfile];
                self.users2Array = @[@[serialNumber,corporateName],@[tel,city],@[personalProfile,@""]];
            }
            [self.tableview reloadData];
        } failure:^(NSString * _Nullable errorMessage) {
            
        }];
        
        
    } failure:^(NSString * _Nullable errorMessage) {
        
    }];
}
-(void)noticeAction:(NSNotification *)noti{
    NSString *typeStr = noti.userInfo[@"bool"];
    if ([typeStr isEqual:@"defaultV"]) {
        self.defaluetStyle = YES;
        _bgImageView.image = [UIImage imageNamed:@"bg1"];
    }else{
        self.defaluetStyle  = NO;
        _bgImageView.image = [UIImage imageNamed:@"bg2"];
    }
    [self.tableview reloadData];
}
-(void)setNavgationBackBtn{
    [super setNavgationBackBtn];
    [self.backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.backButton setImage:[UIImage imageNamed:@"back2"] forState:UIControlStateNormal];
    self.navigationItem.title = @"掌上名片";
    [self.navigationController.navigationBar setTitleTextAttributes:
    @{NSFontAttributeName:[UIFont systemFontOfSize:16],
    NSForegroundColorAttributeName:[UIColor whiteColor]}];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:@"share22"] forState:UIControlStateNormal];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    [btn addTarget:self action:@selector(goToShareInformation:) forControlEvents:UIControlEventTouchUpInside];
}
//分享的操作
-(void)goToShareInformation:(UIButton *)btn{
    WS(weakSelf)
    LKUserInfor *user = [LKUserInforTool account];
    NSDictionary *param = [NSDictionary dictionaryWithObjectsAndKeys:user.userSerialNumber,@"UserSerialNumber", nil];
    [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:zhangShangCardShareUrl header:[LKUserInforTool header] parameters:param progress:^(NSProgress * _Nullable progress) {
        
    } success:^(BOOL isSuccess, id  _Nullable responseObject) {
        [UMSocialUIManager setPreDefinePlatforms:@[@(UMSocialPlatformType_WechatSession),@(UMSocialPlatformType_WechatTimeLine),@(UMSocialPlatformType_QQ),@(UMSocialPlatformType_Qzone),@(UMSocialPlatformType_Sms)]];
        LKUserInfor *user = [LKUserInforTool account];
        
        NSString *shareUrl;
        if (self.defaluetStyle) {
            shareUrl = [NSString stringWithFormat:@"%@?UserSerialNumber=%@&TypeId=1",responseObject[@"careShareUrl"],user.userSerialNumber];
        }else{
            shareUrl = [NSString stringWithFormat:@"%@?UserSerialNumber=%@&TypeId=2",responseObject[@"careShareUrl"],user.userSerialNumber];
        }
        [UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType, NSDictionary *userInfo) {
            [weakSelf shareWebPageToPlatformType:platformType Andurl:shareUrl];
        }];
    } failure:^(NSString * _Nullable errorMessage) {
        
    }];
    

//    [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:zhangShangCardShareUrl header:[LKUserInforTool header] parameters:nil progress:^(NSProgress * _Nullable progress) {
//
//    } success:^(BOOL isSuccess, id  _Nullable responseObject) {
//        LKWebViewController *vc = [[LKWebViewController alloc] init];
//        NSString *url = @"http://";
//        NSString *finalUrl = [NSString stringWithFormat:@"%@%@?UserSerialNumber=%@",url,responseObject[@"result"],[LKUserInforTool account].userSerialNumber];
//        vc.url = finalUrl;
////        vc.url = [NSString stringWithFormat:@"%@%@",url,responseObject[@"result"]];
//
//        [self.navigationController pushViewController:vc animated:YES];
//    } failure:^(NSString * _Nullable errorMessage) {
//
//    }];
}
-(void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:animated];
    CGFloat offset = 0;
    [self.navigationController.navigationBar
     setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:201/255.0 blue:31/255.0 alpha:(offset / 64)>0.99?0.99:(offset / 64)]] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar
     setShadowImage:[UIImage new]];
    [self.tableview reloadData];
}
-(UIImage*) imageWithColor:(UIColor*) color
{
    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
    
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = nil;
    [self.navigationController.navigationBar setTitleTextAttributes:
     @{NSFontAttributeName:[UIFont systemFontOfSize:16],
       NSForegroundColorAttributeName:[UIColor blackColor]}];
    [_bgView removeFromSuperview];
    [_chooseView removeFromSuperview];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    if (_defaluetStyle) {
       return self.imagesArray.count;
    }
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (_defaluetStyle) {
        LKMineCardCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LKMineCardCell"];
        cell.iconImageView.image = [UIImage imageNamed:self.imagesArray[indexPath.section]];
        cell.contentLabel.text = self.usersArray[indexPath.section];
        
        return cell;
    }
    LKMIneCardOtherCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LKMIneCardOtherCell"];
    if (indexPath.section == 2) {
        LKMIneCardOtherBottomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LKMIneCardOtherBottomCell"];
        cell.introLabel.text = self.users2Array[indexPath.section][0];
        return cell;
    }
    
    cell.leftLabel.text = self.users2Array[indexPath.section][0];
    cell.rightLabel.text = self.users2Array[indexPath.section][1];
    cell.leftIconImageView.image = [UIImage imageNamed:self.images2Array[indexPath.section][0]];
    cell.rightIconImageView.image = [UIImage imageNamed:self.images2Array[indexPath.section][1]];
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (_defaluetStyle) {
        return UITableViewAutomaticDimension;
    }else{
        if (indexPath.section == 2) {
            return UITableViewAutomaticDimension;
        }
        return 65;
    }
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (_defaluetStyle) {
       return section == 0 ? 180:0.000000000001;
    }
    return section == 0 ? 180:0.00000000001;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    if (_defaluetStyle) {
        return section == self.imagesArray.count - 1 ? 90: 0.0000000000001;
    }
    return section == 2 ? 133: 0.0000000000001;

}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    if (section == 0) {
        if (_defaluetStyle) {
           LKMineCardHeaderView *headerView = [[[NSBundle mainBundle] loadNibNamed:@"LKMineCardHeaderView" owner:self options:nil] lastObject];
            [headerView.editBtn addTarget:self action:@selector(editUserInformation:) forControlEvents:UIControlEventTouchUpInside];
            LKUserInfor *user = [LKUserInforTool account];
            [headerView.touxiangImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",ServerlUrl,user.headPortrait]] placeholderImage:[UIImage imageNamed:@"minecardtouxiang"]];
            headerView.touxiangImageView.layer.cornerRadius = 50;
            headerView.touxiangImageView.layer.masksToBounds = YES;
            return headerView;
        }else{
            LKMineCardHeaderOtherView *headerView = [[[NSBundle mainBundle] loadNibNamed:@"LKMineCardHeaderOtherView" owner:self options:nil] lastObject];
            [headerView.editBtn addTarget:self action:@selector(editUserInformation:) forControlEvents:UIControlEventTouchUpInside];
            LKUserInfor *user = [LKUserInforTool account];
            NSString *userName = [NSString judegeIsNullAndTransform:user.name];
            NSString *postName = [NSString judegeIsNullAndTransform:user.postName];
            NSString *PosposName = [NSString stringWithFormat:@"(%@)",postName];
            headerView.userNameLabel.text = userName;
            headerView.postLabel.text = PosposName;
            [headerView.touxiangImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",ServerlUrl,user.headPortrait]] placeholderImage:[UIImage imageNamed:@"minecardtouxiang"]];
            headerView.touxiangImageView.layer.cornerRadius = 50;
            headerView.touxiangImageView.layer.masksToBounds = YES;
            return headerView;
        }

    }
    return [[UIView alloc] init];
    
}
//编辑用户个人资料
-(void)editUserInformation:(UIButton *)btn{
    LKDayInforPersonInforEditViewController *vc = [[LKDayInforPersonInforEditViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    UIView *footerView = [[UIView alloc] init];
    if (_defaluetStyle) {
        if (section == self.imagesArray.count - 1) {
            UIButton *typeChooseBtn =[UIButton buttonWithType:UIButtonTypeCustom];
            [typeChooseBtn setTitleColor:COLOR_HEX(0xFFA200) forState:UIControlStateNormal];
            [typeChooseBtn setTitle:@"选择样式->" forState:UIControlStateNormal];
            [typeChooseBtn addTarget:self action:@selector(typeChoose:) forControlEvents:UIControlEventTouchUpInside];
            [footerView addSubview:typeChooseBtn];
            [typeChooseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerX.bottom.equalTo(footerView);
                make.height.mas_equalTo(39);
                make.width.mas_equalTo(130);
            }];
            typeChooseBtn.layer.borderColor = COLOR_HEX(0xFFA200).CGColor;
            typeChooseBtn.layer.borderWidth = 1;
            typeChooseBtn.layer.cornerRadius = 3;
            typeChooseBtn.layer.masksToBounds = YES;
            return footerView;
        }
    }else{
        if (section == 2) {
            UIButton *typeChooseBtn =[UIButton buttonWithType:UIButtonTypeCustom];
            [typeChooseBtn setTitleColor:COLOR_HEX(0xFFA200) forState:UIControlStateNormal];
            [typeChooseBtn setTitle:@"选择样式->" forState:UIControlStateNormal];
            [typeChooseBtn addTarget:self action:@selector(typeChoose:) forControlEvents:UIControlEventTouchUpInside];
            [footerView addSubview:typeChooseBtn];
            [typeChooseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerX.bottom.equalTo(footerView);
                make.height.mas_equalTo(39);
                make.width.mas_equalTo(130);
            }];
            typeChooseBtn.layer.borderColor = COLOR_HEX(0xFFA200).CGColor;
            typeChooseBtn.layer.borderWidth = 1;
            typeChooseBtn.layer.cornerRadius = 3;
            typeChooseBtn.layer.masksToBounds = YES;
            return footerView;
        }
    }

    return footerView;
}
-(void)typeChoose:(UIButton *)btn{
    if (!_bgView) {
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
        self.bgView.alpha = 0.5f;
        self.bgView.backgroundColor = [UIColor blackColor];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removebackView:)];
        [self.bgView addGestureRecognizer:tap];
    }
    if (!_chooseView) {
        _chooseView = [[[NSBundle mainBundle] loadNibNamed:@"LKMineCardTypeChooseView" owner:self options:nil] lastObject];
        [self.view addSubview:_chooseView];
        [self.view bringSubviewToFront:_chooseView];
        [_chooseView.sureBtn addTarget:self action:@selector(chooseTypeAndRefresh) forControlEvents:UIControlEventTouchUpInside];
        [_chooseView.cancelBtn addTarget:self action:@selector(removebackView) forControlEvents:UIControlEventTouchUpInside];
    }
    [[UIApplication sharedApplication].keyWindow addSubview:self.bgView];
    [[UIApplication sharedApplication].keyWindow addSubview:self.chooseView];
     _chooseView.frame = CGRectMake(0,HEIGHT - 304, WIDTH, 304);


}
-(void)chooseTypeAndRefresh{
    [_chooseView removeFromSuperview];
    [_bgView removeFromSuperview];
    if (_defaluetStyle) {
        _bgImageView.image = [UIImage imageNamed:@"bg1"];
    }else{
        _bgImageView.image = [UIImage imageNamed:@"bg2"];
    }
    [self.tableview reloadData];
    
//    self.selectStyle = _defaluetStyle;
//    if (self.selectStyle) {
//        _bgImageView.image = [UIImage imageNamed:@"bg1"];
//    }else{
//        _bgImageView.image = [UIImage imageNamed:@"bg2"];
//    }
//    [self.tableview reloadData];
}
-(void)removebackView:(UITapGestureRecognizer *)tap{

    [UIView animateWithDuration:0.5 animations:^{
        UIView *view = tap.view;
        [view removeFromSuperview];
        [_chooseView removeFromSuperview];
    }];
}
-(void)removebackView{
    if (_defaluetStyle) {
        _bgImageView.image = [UIImage imageNamed:@"bg1"];
    }else{
        _bgImageView.image = [UIImage imageNamed:@"bg2"];
    }
    [UIView animateWithDuration:0.5 animations:^{
        [_bgView removeFromSuperview];
        [_chooseView removeFromSuperview];
    }];
    [self.tableview reloadData];
}
-(NSArray *)titlesArray{
    if (!_titlesArray) {
        _titlesArray = @[@"",@"业务指标",@"拜访记录"];
    }
    return _titlesArray;
}
-(NSArray *)imagesArray{
    if (!_imagesArray) {
        _imagesArray = @[@"xingming",@"yuangognbianhao",@"gongsi",@"tel",@"dizhi",@"gerenjianjie"];
    }
    return _imagesArray;
}
-(NSArray *)images2Array{
    if (!_images2Array) {
        _images2Array = @[@[@"yuangognbianhao",@"gongsi"],@[@"tel",@"dizhi"],@[@"gerenjianjie"]];
    }
    return _images2Array;
}
- (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType Andurl:(NSString *)url
{
    //创建分享消息对象
    UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
    //创建网页内容对象
        LKUserInfor *user = [LKUserInforTool account];
    NSString* thumbURL =  @"";
    UIImage *image = [UIImage imageNamed:@"LOGO"];
    NSString *titles = [NSString stringWithFormat:@"%@的掌上名片",user.name];
    NSString *descrip = [NSString stringWithFormat:@"点击链接即可了解%@的详情",user.name];
    UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:titles descr:descrip thumImage:image];
    //设置网页地址
    
    shareObject.webpageUrl = url;
    //分享消息对象设置分享内容对象
    messageObject.shareObject = shareObject;
    //调用分享接口
    [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
        if (error) {
            UMSocialLogInfo(@"************Share fail with error %@*********",error);
        }else{
            if ([data isKindOfClass:[UMSocialShareResponse class]]) {
                UMSocialShareResponse *resp = data;
                //分享结果消息
                UMSocialLogInfo(@"response message is %@",resp.message);
                //第三方原始返回的数据
                UMSocialLogInfo(@"response originalResponse data is %@",resp.originalResponse);
            }else{
                UMSocialLogInfo(@"response data is %@",data);
            }
        }
    }];
}
-(NSArray *)usersArray{
    if (!_usersArray) {
        LKUserInfor *user = [LKUserInforTool account];
        NSString *userName = [NSString judegeIsNullAndTransform:user.name];
        NSString *postName = [NSString judegeIsNullAndTransform:user.postName];
        NSString *positonName = [NSString stringWithFormat:@"%@(%@)",userName,postName];
        NSString *serialNumber = [NSString judegeIsNullAndTransform:user.userSerialNumber];
        NSString *corporateName = [NSString judegeIsNullAndTransform:user.corporateName];
        NSString *tel = [NSString judegeIsNullAndTransform:user.tel];
        NSString *city = [NSString judegeIsNullAndTransform:user.city];
        NSString *personalProfile = [NSString judegeIsNullAndTransform:user.personalProfile];
        _usersArray = @[positonName,serialNumber,corporateName,tel,city,personalProfile];
    }
    return _usersArray;
}
-(NSArray *)users2Array{
    if (!_users2Array) {
        LKUserInfor *user = [LKUserInforTool account];
        NSString *serialNumber = [NSString judegeIsNullAndTransform:user.userSerialNumber];
        NSString *corporateName = [NSString judegeIsNullAndTransform:user.corporateName];
        NSString *tel = [NSString judegeIsNullAndTransform:user.tel];
        NSString *city = [NSString judegeIsNullAndTransform:user.city];
        NSString *personalProfile = [NSString judegeIsNullAndTransform:user.personalProfile];
        _users2Array = @[@[serialNumber,corporateName],@[tel,city],@[personalProfile,@""]];
    }
    return _users2Array;
}

-(void)dealloc{
    NSLog(@"释放");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
